package com.dc.dao;

import com.dc.dao.vo.CalibrationShipOldReturnVO;
import com.dc.dao.vo.CalibrationShipWeldReturnVO;
import com.dc.entity.CalibrationShipOldEntity;
import com.dc.entity.CalibrationShipWeldEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface CalibrationShipWeldDao extends JpaRepository<CalibrationShipWeldEntity, Long>, JpaSpecificationExecutor<CalibrationShipWeldEntity> {


//    @Query(nativeQuery = true,
//            value = "SELECT " +
//                    " tcsc.id AS id," +
//                    " tcsc.ship_id as shipId," +
//                    " ts.name as shipName," +
//                    " tcsc.length as length," +
//                    " tcsc.date as date," +
//                    " tcsc.machine_num as machineNum," +
//                    " tcsc.t_co2 as startCO2," +
//                    " tcsc.end_co2 as endCO2," +
//                    " tcsc.co2 as co2," +
//                    " tcsc.co2_by_unit as co2ByUnit," +
//                    " tcsc.powers as powers," +
//                    " tcsc.power_by_unit as powerByUnit " +
//                    " FROM " +
//                    " t_calibration_ship_weld tcsc JOIN t_ship ts ON tcsc.ship_id = ts.id",
//            countQuery = "SELECT count(1) from t_calibration_ship_weld tcsc JOIN t_ship ts ON tcsc.ship_id = ts.id")
//    public Page<CalibrationShipWeldReturnVO> findAllByPage(Pageable pageable);

}
